class CommandExecutor {
  static async execute<T>(command: ICommand<T>): Promise<T> {
    // 命令验证（可根据需求扩展）
    CommandValidator.validate(command)

    // 日志记录
    Logger.log(`Executing ${command.constructor.name}`)

    // 性能监控
    const startTime = performance.now()
    const result = await command.execute()
    const duration = performance.now() - startTime

    Metrics.track(command.service, command.method, duration)
    return result
  }
}
